package com.wgchao.identityrightsmanagement.infrastructure.jpa.repository;

import com.wgchao.identityrightsmanagement.infrastructure.jpa.entity.SysBaseDepartment;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;
import java.util.List;

/**
 * @ClassName: SysBaseDepartmentRepository
 * @author: wgchao
 * @createTime: 2020/6/15 5:28 PM
 * @Description: TODO
 */
@Repository
public interface SysBaseDepartmentRepository extends JpaRepository<SysBaseDepartment, Long>, JpaSpecificationExecutor<SysBaseDepartment> {
    SysBaseDepartment findFirstByCodeAndDelIsFalse(String code);
    SysBaseDepartment findFirstByCode(String code);
    List<SysBaseDepartment> findAllByAgencyCodeAndDelIsFalse(String agencyCode);
}
